#!/usr/bin/node

const log = console.log,
      Dog = require('./05-dog.js');

let teddy = new Dog('teddy',4);
let shepherd = new Dog('shepherd',8);

teddy.on('bark',onBark.bind(teddy));
shepherd.on('bark',onBark.bind(shepherd));

function onBark(){
  log(`${this.name} barked! enery:${this.enery}`);
}

